#set(CMAKE_CXX_FLAGS "-gdwarf-2 -g -O2")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_FLAGS "${CAMKE_CXX_FLAGS} -std=c++11 -pthread")
#SET(CMAKE_BUILD_TYPE Release)
SET(CMAKE_BUILD_TYPE Debug)
#ignore ._xxxxx.cpp  
 
add_definitions(-DLOGIN_SERVER)

#option(TARS_MYSQL "option for mysql" ON)
#include (/usr/local/tars/cpp/makefile/tars-tools.cmake)

file(GLOB_RECURSE sources_3RD ../3rd/[^.]*.cc ../3rd/[^.]*.h)
#file(GLOB_RECURSE sources_BASE ../base/[^.]*.cc ../base/[^.]*.h)
file(GLOB_RECURSE sources_CORE ../NetCore/[^.]*.cpp ../NetCore/[^.]*.h)
#file(GLOB_RECURSE sources_TARS ../tars/[^.]*.cpp ../tars/[^.]*.h)
#file(GLOB_RECURSE sources_SHARE_DATA ../share/data/[^.]*.cpp ../share/data/[^.]*.h)
file(GLOB sources [^.]*.cpp [^.]*.h)

set(Loginserver_STAT_SRCS
  ${sources}
  ${sources_CORE}
  ${sources_3RD}
#  ${sources_BASE}
#  ${sources_TARS}
 # ${sources_SHARE_DATA}
) 
 
#message(status " This is the server_share srcs:" ${sources_SERVER_SHARE})
#message(status " This is the share srcs:" ${sources_SHARE})
#message(status " This is the share data srcs:" ${sources_SHARE_DATA})

include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}/../3rd
  ${CMAKE_CURRENT_SOURCE_DIR}/../3rd/csv
  ${CMAKE_CURRENT_SOURCE_DIR}/../3rd/inih/cpp
  ${CMAKE_CURRENT_SOURCE_DIR}/../base
  ${CMAKE_CURRENT_SOURCE_DIR}/../NetCore
  ${CMAKE_CURRENT_SOURCE_DIR}/../NetCore/xLog
#  ${CMAKE_CURRENT_SOURCE_DIR}/../tars/
  /usr/include
#  /usr/local/tars/cpp/thirdparty/include
) 

LINK_DIRECTORIES(
  /usr/local/lib
#  /usr/local/tars/cpp/thirdparty/lib 
)

#gen_server(ServiceController Loginserver)

add_executable(Loginserver ${Loginserver_STAT_SRCS})
target_link_libraries(Loginserver mysqlclient)
target_link_libraries(Loginserver pthread)

#target_link_libraries(Loginserver ${LIB_TARS_SERVANT} ${LIB_TARS_UTIL})
 